Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

17.8 Clock Tick Mechanism Configuration

Linux relies on periodic hardware clock ticks (the scheduling tick) to orchestrate real-time task scheduling. When the system rests in an idle state, continuous clock tick tracking cycles consume substantial hardware power; conversely, for high-performance computing workloads, handling these persistent ticks introduces significant pipeline interruptions and degrades computation velocity. To eliminate this overhead, Linux implements the compilation configuration flag CONFIG_NO_HZ_COMMON, which allows the operating system to dynamically suspend or adaptively interrupt the scheduling clock tick. This framework relies on a global nohz administrative structure. If CONFIG_NO_HZ_COMMON is enabled (a configuration standard across modern production distributions), init_sched_fair_class() handles the initialization of this nohz infrastructure.

Within the nohz management block, the bitmask idle_cpus_mask is leveraged to record which specific CPU cores currently reside in a NO_HZ (tickless) operational state. If the $i$-th bit within this mask evaluates to 1, it denotes that CPU $i$ is currently resting in an idle state and has completely suspended its scheduling clock tick. When CONFIG_NO_HZ_COMMON is active, init_sched_fair_class() invokes zalloc_cpumask_var(&nohz.idle_cpus_mask, GFP_NOWAIT) to allocate and zero-initialize this idle CPU bitmask variable to track tickless idle processor cores.

Copyright © 2026 Guangzhou eSmart Information Technology Co., Ltd. All Rights Reserved.
All content in this book is copyrighted by the author. For personal learning and exchange only. Commercial use without authorization is strictly prohibited. Email:

✉ 3348194517@qq.com | hai616878@gmail.com